﻿using Handy_DNS.Controls;
using HandyControl.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Handy_DNS.View.UserControl.Menu
{
    /// <summary>
    /// MenuMainContent.xaml 的交互逻辑
    /// </summary>
    public partial class MenuMainContent
    {
        Action<string> action;
        public MenuMainContent(Action<string> action)
        {
            InitializeComponent();

            this.action = action;
            this.action(defaultBtn.Source);
        }

        private string menuSource="";

        public string MenuSource
        {
            get { return menuSource; }
            set { menuSource = value; this.action(value); }
        }

        private void Menu_Click(object sender, RoutedEventArgs e)
        {
            MenuButton menuBtn = (MenuButton)sender;
            this.MenuSource = menuBtn.Source;
            //Growl.Info(this.MenuSource);
        }
    }
}
